package com.demo.media;

import java.util.List;

import com.jfinal.kit.StringKit;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;


public class WxImg extends Model<WxImg>{
    public static final WxImg dao = new WxImg();

	//columns END

    public List<WxImg> findAll() {
        return find("select * from wx_img");
    }
    /**
     * @param   where
     * @return  Record
     */
    public List<Record> findAlls(String where) {
        String sqlExp = " from wx_img";
        if(StringKit.notBlank(where)){
                sqlExp += " where " + where;
        }
                return Db.find( "select * " +sqlExp );

    }

    public Page<WxImg> page(int pageNumber, int pageSize, String where) {
        String sqlExp = "from wx_img";
        if(StringKit.notBlank(where)){
            sqlExp += " where " + where;
        }
        return paginate(pageNumber, pageSize, "select *", sqlExp);
    }
}

